//package org.example;
//
//import java.io.FileNotFoundException;
//import java.io.RandomAccessFile;
//import java.nio.channels.FileChannel;
//import java.nio.channels.FileLock;
//
//public class TestLock {
//    public static void main(String[] args) throws FileNotFoundException {
//        FileChannel fileChannel=new RandomAccessFile("test.lock","rw").getChannel();
//        FileLock lock = fileChannel.lock(4, 1, true);
//        lock.release();
//    }
//}
